package com.xqls.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqls.bean.RegisterBean;
import com.xqls.dal.dao.RegisterDao;
import com.xqls.dal.model.Register;
import com.xqls.service.RegisterService;
import com.xqls.util.ObjectUtil;

@Service
public class RegisterServiceImpl implements RegisterService{
@Autowired private RegisterDao dao;

	@Override
	public List<Map<String, Object>> queryByMap(Map<String, Object> map) {
		return dao.selectByMap(map);
	}

	@Override
	public RegisterBean queryByKey(Integer key) {
		return (RegisterBean) ObjectUtil.transfer(dao.selectByKey(key), RegisterBean.class);
	}

	@Override
	public boolean deleteList(List<Integer> keys) {
		return dao.deleteList(keys);
	}

	@Override
	public boolean add(RegisterBean bean) {
		return dao.insert((Register)ObjectUtil.transfer(bean, Register.class));
	}

	@Override
	public boolean update(RegisterBean bean) {
		return dao.updatRegister((Register)ObjectUtil.transfer(bean, Register.class));
	}
	
}
